home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / disk utilities / backup / backup_restore / backup_src_v3.20.lha / StringGadgets.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-04  |  1.8 KB  |  77 lines

  1. /* StringGadgets.c */
  2. /* 04 Feb 1996 14:12:16 */
  3.  
  4. #ifndef    BACKUP_INCLUDE
  5. #include "IncludeAll.c"
  6. #endif
  7. #include "Backup.h"
  8. #include "Backup_proto.h"
  9. #include "BackupStrings.h"
  10.  
  11.  
  12. static void __interrupt StrGadHookFunction(struct Hook *hook, struct SGWork *sgw, ULONG *msg);
  13.  
  14.  
  15. /* Ersatz für struct Hook, mit Funktions-Prototyp */
  16. struct myHook
  17.     {
  18.     struct MinNode    h_MinNode;
  19.     ULONG        (*h_Entry)();    /* assembler entry point    */
  20.     ULONG         (*h_SubEntry)(struct Hook *, struct SGWork *, ULONG *);/* often HLL entry point    */
  21.     VOID        *h_Data;    /* owner specific        */
  22.     };
  23.  
  24.  
  25. struct Hook StrGadEditHook = 
  26.     {
  27.     { NULL },
  28.     HookEntry,
  29.     (ULONG (*)()) StrGadHookFunction,
  30.     NULL
  31.     };
  32.  
  33.  
  34. /* kein Stack Check, daher __interrupt !!! */
  35. static void __interrupt StrGadHookFunction(struct Hook *hook, struct SGWork *sgw, ULONG *msg)
  36. {
  37.     if (*msg == SGH_KEY)
  38.         {
  39.         if (sgw->IEvent->ie_Qualifier & IEQUALIFIER_RCOMMAND)
  40.             {
  41.             /* Menu-Kürzel am String-Gadget vorbeileiten */
  42.             sgw->Code = (USHORT) GADCODE_NOP;
  43.             sgw->Actions |= SGA_END | SGA_REUSE;
  44.             }
  45.         else
  46.             {
  47.             switch (sgw->IEvent->ie_Code)
  48.                 {
  49.             case 0x4c:    /* Up Arrow */
  50.                 if (sgw->IEvent->ie_Qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT))
  51.                     sgw->Code = GADCODE_PAGEUP;
  52.                 else if (sgw->IEvent->ie_Qualifier & IEQUALIFIER_CONTROL)
  53.                     sgw->Code = GADCODE_TOP;
  54.                 else
  55.                     sgw->Code = GADCODE_UP;
  56.  
  57.                 sgw->Actions |= SGA_END;
  58.                 break;
  59.             case 0x4d:    /* Down Arrow */
  60.                 if (sgw->IEvent->ie_Qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT))
  61.                     sgw->Code = GADCODE_PAGEDOWN;
  62.                 else if (sgw->IEvent->ie_Qualifier & IEQUALIFIER_CONTROL)
  63.                     sgw->Code = GADCODE_BOTTOM;
  64.                 else
  65.                     sgw->Code = GADCODE_DOWN;
  66.  
  67.                 sgw->Actions |= SGA_END;
  68.                 break;
  69.             case 0x45:    /* Escape */
  70.                 sgw->Actions |= SGA_END;
  71.                 sgw->Code = GADCODE_CANCEL;
  72.                 break;
  73.                 }
  74.             }
  75.         }
  76. }
  77.